Skip to content

Add support for cloning Error#5844

Merged
tomekzaw merged 2 commits intomainfrom
@tomekzaw/shareable-error
Mar 28, 2024
Merged

Add support for cloning Error#5844
tomekzaw merged 2 commits intomainfrom
@tomekzaw/shareable-error

Conversation

@tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented Mar 27, 2024

Summary

This PR adds support for cloning JS Error instances from RN runtime to UI runtime (or any worklet runtime).

The copied error inherits the original name, message as well as stack trace.

Initially, I also wanted to implement cloning in the opposite direction (UI → RN) but currently makeShareableCloneOnUIRecursive does not support initializers and most likely will be subject to change as we plan to unify the implementation of cloning across the runtimes.

Test plan

ShareableExample.tsx

@tomekzaw tomekzaw requested review from piaskowyk and tjzel March 27, 2024 16:11
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants